# -*- coding: utf-8 -*-
# Powered By: ECHO
# @Time : 2020/8/22 12:11
# -*- coding: utf-8 -*-
import time

import cv2
from selenium import webdriver
from slide.Slide import Slide



driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.maximize_window()
driver.get('https://i.qq.com/')

driver.switch_to.frame(driver.find_element_by_xpath('//*[@id="login_frame"]'))
driver.find_element_by_xpath('//*[@id="switcher_plogin"]').click()
driver.find_element_by_xpath('//*[@id="u"]').send_keys('213123123')
driver.find_element_by_xpath('//*[@id="p"]').send_keys('123213')
driver.find_element_by_xpath('//*[@id="login_button"]').click()

time.sleep(3)
driver.switch_to.frame(driver.find_element_by_xpath('//*[@id="tcaptcha_iframe"]'))
ele = driver.find_element_by_xpath('//*[@id="slideBg"]')
ele1= driver.find_element_by_xpath('//*[@id="slideBlock"]')
slide = Slide(driver)
# s = slide.FindPic()
# print(s)
slide.slide_verify('//*[@id="slideBg"]','//*[@id="slideBlock"]',
                   jsonp='{"offset":22,"zoom":1,"refresh":"//*[@id=\\\"e_reload\\\"]"}')


# driver = webdriver.Chrome()
# driver.maximize_window()
# driver.implicitly_wait(10)
# driver.get('https://passport.jd.com/new/login.aspx')
#
# driver.find_element_by_xpath('//*[@id="content"]/div[2]/div[1]/div/div[3]/a').click()
# driver.find_element_by_xpath('//*[@id="loginname"]').send_keys('wuqingfadqng')
# driver.find_element_by_xpath('//*[@id="nloginpwd"]').send_keys('dsafds')
# driver.find_element_by_xpath('//*[@id="loginsubmit"]').click()
#
# time.sleep(3)

# ele = driver.find_element_by_xpath('//*[@id="JDJRV-wrap-loginsubmit"]/div/div/div/div[1]/div[2]/div[1]/img')
# ele1 = driver.find_element_by_xpath('//*[@id="JDJRV-wrap-loginsubmit"]/div/div/div/div[1]/div[2]/div[2]/img')

# slide = Slide(driver)
# slide.slide_verify('//*[@id="JDJRV-wrap-loginsubmit"]/div/div/div/div[1]/div[2]/div[1]/img',
#                    '//*[@id="JDJRV-wrap-loginsubmit"]/div/div/div/div[1]/div[2]/div[2]/img',
#                    jsonp='{"zoom":1.25,"template-zoom":0.76,"offset":3,"offset-x":20,"offset-y":308,"slide":"pyautogui"}')



# driver = webdriver.Chrome()
# driver.maximize_window()
# driver.implicitly_wait(10)
# driver.get('https://union.bytedance.com/open/')
#
# driver.find_element_by_xpath('//*[@id="root"]/div/div[2]/div[7]/div[1]').click()
# driver.find_element_by_xpath('//*[@id="root"]/div/div[2]/div[8]/div/div[1]/div[2]').click()
# time.sleep(3)
# driver.find_element_by_xpath('//*[@id="root"]/div/div[2]/div[8]/div/div[2]/div[2]/div[1]/input').send_keys('15556786666')
# driver.find_element_by_xpath('//*[@id="root"]/div/div[2]/div[8]/div/div[2]/div[2]/div[2]/div/div').click()
#
# time.sleep(3)
#
# slide = Slide(driver)
# slide.slide_verify('//*[@id="captcha_container"]/div/div[2]/img[1]',
#                    '//*[@id="captcha_container"]/div/div[2]/img[2]',
#                    jsonp='{"zoom":1.25,"template-zoom":1.235,"offset-x":30,"offset-y":444,"slide":"puautogui"}')
